<% layout('/layouts/default.html', {title: '准考证号管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('准考证号管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('zx:examination:ticket:texaminationTicket:edit')){ %>
					<a href="${ctx}/zx/examination/ticket/texaminationTicket/form" class="btn btn-default btnTool hide" title="${text('新增准考证号')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${texaminationTicket}" action="${ctx}/zx/examination/ticket/texaminationTicket/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('用户标识')}：</label>
					<div class="control-inline">
						<#form:input path="userId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考试标识')}：</label>
					<div class="control-inline">
						<#form:input path="examId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考试名称')}：</label>
					<div class="control-inline">
						<#form:input path="examName" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考生姓名')}：</label>
					<div class="control-inline">
						<#form:input path="studentName" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('身份证号')}：</label>
					<div class="control-inline">
						<#form:input path="idCard" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考生单位名称')}：</label>
					<div class="control-inline">
						<#form:input path="officeName" maxlength="250" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('单位标识')}：</label>
					<div class="control-inline">
						<#form:input path="officeId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考试开始时间')}：</label>
					<div class="control-inline">
						<#form:input path="theoryStarttime" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考试结束时间')}：</label>
					<div class="control-inline">
						<#form:input path="theoryEndtime" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考点')}：</label>
					<div class="control-inline">
						<#form:input path="examPoint" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考场名称')}：</label>
					<div class="control-inline">
						<#form:input path="examRoom" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('座位号')}：</label>
					<div class="control-inline">
						<#form:input path="seatNum" maxlength="30" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('地址')}：</label>
					<div class="control-inline">
						<#form:input path="examAddress" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('实操开始时间')}：</label>
					<div class="control-inline">
						<#form:input path="actualStarttime" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('实操结束时间')}：</label>
					<div class="control-inline">
						<#form:input path="actualEndtime" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('头像')}：</label>
					<div class="control-inline">
						<#form:input path="headPortrait" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("考生姓名")}', name:'studentName', index:'a.student_name', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/zx/examination/ticket/texaminationTicket/form?id='+row.id+'" class="btnList" data-title="${text("编辑准考证号")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("考试标识")}', hidden:true, name:'examId', index:'a.exam_id', width:150, align:"left"},
		{header:'${text("考试名称")}', name:'examName', index:'a.exam_name', width:150, align:"left"},
		{header:'${text("身份证号")}', name:'idCard', index:'a.id_card', width:150, align:"left"},
		{header:'${text("考生单位名称")}', name:'officeName', index:'a.office_name', width:150, align:"left"},
		{header:'${text("单位标识")}',hidden:true, name:'officeId', index:'a.office_id', width:150, align:"left"},
		{header:'${text("考试开始时间")}', hidden:true, name:'theoryStarttime', index:'a.theory_starttime', width:150, align:"center"},
		{header:'${text("考试结束时间")}', hidden:true, name:'theoryEndtime', index:'a.theory_endtime', width:150, align:"center"},
		{header:'${text("考点")}', name:'examPoint', index:'a.exam_point', width:150, align:"left"},
		{header:'${text("考场名称")}', name:'examRoom', index:'a.exam_root', width:150, align:"left"},
		{header:'${text("座位号")}', name:'seatNum', index:'a.seat_num', width:150, align:"center"},
		{header:'${text("理论地址")}', name:'roomAddress', index:'a.room_address', width:150, align:"left"},
		{header:'${text("实操开始时间")}', hidden:true, name:'actualStarttime', index:'a.actual_starttime', width:150, align:"center"},
		{header:'${text("实操结束时间")}', hidden:true, name:'actualEndtime', index:'a.actual_endtime', width:150, align:"center"},
		{header:'${text("头像")}', name:'headPortrait', index:'a.head_portrait', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('zx:examination:ticket:texaminationTicket:edit')){ %>
				actions.push('<a href="${ctx}/zx/examination/ticket/texaminationTicket/form?id='+row.id+'" class="btnList" title="${text("编辑准考证号")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/zx/examination/ticket/texaminationTicket/disable?id='+row.id+'" class="btnList" title="${text("停用准考证号")}" data-confirm="${text("确认要停用该准考证号吗？")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
				} else if (row.status == Global.STATUS_DISABLE){
					actions.push('<a href="${ctx}/zx/examination/ticket/texaminationTicket/enable?id='+row.id+'" class="btnList" title="${text("启用准考证号")}" data-confirm="${text("确认要启用该准考证号吗？")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
				}
				actions.push('<a href="${ctx}/zx/examination/ticket/texaminationTicket/delete?id='+row.id+'" class="btnList" title="${text("删除准考证号")}" data-confirm="${text("确认要删除该准考证号吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>